﻿@model JT.WEB.Views.PaginatedList<JT.Domain.Summary>

@{
    ViewData["Title"] = "Index";
}

<h1>财务凭证管理</h1>

<p>
    <a asp-action="Create" class="btn btn-outline-success">开始记账</a>
    @*<a asp-action="DeleteAll">删除全部  </a>*@
</p>
<p></p>
<form asp-action="Index" method="get">
    <div class="form-actions no-color">
        <div class="form-row ">
            <div class="col-sm-4 input-group">
                <input type="text" name="SearchString" value="@ViewData["currentFilter"]" class="form-control" />

                <input type="submit" value="搜索" class="btn  btn-primary" />
            </div>

        </div>
    </div>
</form>
<table class="table">
    <thead>
        <tr>
            <th>
                摘要
            </th>
            <th>
填表人            </th>
            <th>
登记日期            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.SummaryName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Preparer)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DebitDate)
            </td>
            <td>
                <a asp-action="Index" asp-controller="CZongZhangs" asp-route-ZhaiYaoId="@item.Id">修改</a> |
                <a asp-action="Index" asp-controller="CZongZhangs" asp-route-ZhaiYaoId="@item.Id">详细</a> |
                <a asp-action="Delete" asp-route-id="@item.Id">删除</a>
            </td>
        </tr>
}
    </tbody>
</table>

@{
    var prevDisabled = !Model.HasPreviousPage ? "disabled" : "";
    var nextDisabled = !Model.HasNextPage ? "disabled" : "";
}

<a asp-action="Index"
   asp-route-sortOrder="@ViewData["CurrentSort"]"
   asp-route-pageNumber="@(Model.PageIndex - 1)"
   asp-route-currentFilter="@ViewData["CurrentFilter"]"
   asp-route-ZhaiYaoId="@ViewData["currentFilter"]"
   class="btn btn-default @prevDisabled">
    上一页
</a>
<a asp-action="Index"
   asp-route-sortOrder="@ViewData["CurrentSort"]"
   asp-route-pageNumber="@(Model.PageIndex + 1)"
   asp-route-currentFilter="@ViewData["CurrentFilter"]"
   asp-route-SearchString="@ViewData["currentFilter"]"
   class="btn btn-default @nextDisabled">
    下一页
</a>